<?php
/**
 * Created by PhpStorm.
 * User: robot
 * Date: 2018-04-26
 * Time: 16:52
 */

namespace app\base\validate;


use think\Validate;

class PubValidate extends Validate
{

    protected $rule = [
        'user_name|账号' => 'require|email',
        'user_nick|昵称' => 'require|chsAlphaNum|max:15',
        'user_pwd|密码' => 'require|min:6',
        'user_rpwd|重复密码'=>'require|confirm:user_pwd'
    ];
    protected $message = [
        'user_name.require' => '请输入账号',
        'user_name.email' => '账号只能为email格式',

        'user_nick.require' => '请输入昵称',
        'user_nick.chsAlphaNum' => '昵称只能为汉字、字母、数字',
        'user_nick.max' => '昵称最多不超过15个字符',


        'user_pwd.require' => '请输入密码',
        'user_pwd.min' => '密码最小长度为6个字符',
        'user_rpwd.require' => '请输重复密码',
        'user_rpwd.confirm'=>'两次密码输入不一致'
    ];

    protected $scene = [
        'login'  =>  ['user_name','user_pwd'],
        'edit'  =>  ['user_name','user_nick'],
    ];

}